
{% extends 'demo/base.html' %}
{% load common_extras %}
{% block title %}
{{ now_cls | capfirst }}博客—专业IT技术发表平台
{% endblock %}

{% block header %}
{% include 'demo/header.html' %}
{% endblock %}

{% block main %}
    {% include 'demo/classes.html' %}
    {% if articles %}
        <ul class="nav">
            {% for article in articles %}
                <li>
                    {# articles.0第一遍文章数据 #}
                    {% comment %}如果路由定义了转换器或者替他参数，那么就不能使用url模版标签的命名路由跳转到其他的页面{% endcomment %}
                    <a href="/demo/article/{{ article.id }}">
                        <div class="left">
                            <h4>{{ forloop.counter }}、{{ article.title }}</h4>
                            <p>{{ article.desc }}</p>
                            {#<p class="time-info">发布时间：{{ article.create_time | date:'Y年m月d日H:i:s'}}</p>#}
                            <p class="time-info">发布时间：{{ article.create_time | time_since }}</p>

                        </div>
                        <div class="right">
{#                            {{ article.cover }}#}
                            <img src="/static/media/{{ article.cover }}/" alt="">
                        </div>
                    </a>
                </li>
                {% if forloop.last %}
                    <div class="bottom-info">已经是最后一篇文章了</div>

                {% endif %}
            {% endfor %}
        </ul>
    {% else %}
        <div class="bottom-info">没有文章</div>
        <p>{{ str1 | cut:' ' }}</p>
    {% endif %}
{% endblock %}



{#<p>{{ str1 }}</p>#}
{#<p>{{ num }}</p>#}
{{ articles.0.title }}
<hr>
{% with articles.0.title as a1 %}
    {{ a1 }}
{% endwith %}
{% autoescape off %}
    {{ html }}
{% endautoescape %}

